export interface IRect {
  readonly x: number;
  readonly y: number;
  readonly w: number;
  readonly h: number;
}
export class Rect implements IRect {
  public _x: number;
  public _y: number;
  public _w: number;
  public _h: number;
  public constructor(x: number = 0, y: number = 0, w: number = 0, h: number = 0) {
    this._x = x;
    this._y = y;
    this._w = w;
    this._h = h;
  }
  public get x(): number {
    return this._x;
  }
  public set x(value: number) {
    this._x = value;
  }
  public get y(): number {
    return this._y;
  }
  public set y(value: number) {
    this._y = value;
  }
  public get w(): number {
    return this._w;
  }
  public set w(value: number) {
    this._w = value;
  }
  public get h(): number {
    return this._h;
  }
  public set h(value: number) {
    this._h = value;
  }
  set(other: IRect) {
    this._x = other.x;
    this._y = other.y;
    this._w = other.w;
    this._h = other.h;
  }
}